STACK 8000

;     SCRIPT FILENAME: Figlet.def            
;     DATE           : 02-01-95 
;     AUTHOR         : Colin Thompson
;     DESCRIPTION    : Displays figlet text in a window, or sends it to
;                      your text editor.   




;=====  SEE IF THE MASTER LIST OF FONTS EXISTS  ======================


IF NOT EXISTS >NIL: MASTER.LIST


;=====  SEE IF THE FONTS ARE INSTALLED IN LIBS:FIGLETFONTS  ===========

     IF NOT EXISTS LIBS:FIGLETFONTS
          RTEZREQUEST "FIGLET:" "THE FIGLET FONTS ARE NOT INSTALLED\nIF YOU INTEND TO USE AMIGA FIGLET\nFROM THE SHELL, YOU MUST INSTALL THE FONTS" BUTTONTEXT "_INSTALL FONTS PERMANENTLY|_DON'T INSTALL NOW" DEFAULT 0
          SETENV RESULT $RC
     
          IF $RESULT EQ 0
               SETENV LOCATION figletfonts
               LIST >MASTER.LIST $LOCATION  lformat "%N" 
          ELSE
               ECHO "WORKING..." NOLINE
               COPY FIGLETFONTS TO LIBS:FIGLETFONTS QUIET
               RTEZREQUEST "FIGLET:" "THE FONTS ARE INSTALLED IN LIBS:FIGLETFONTS.\nYOU MAY NOW USE FIGLET FROM THE SHELL." BUTTONTEXT "_CONTINUE"
               SETENV LOCATION "libs:figletfonts"
               LIST >MASTER.LIST $LOCATION  lformat "%N" 
          ENDIF
     ELSE
          SETENV LOCATION "LIBS:FIGLETFONTS"
          LIST >MASTER.LIST $LOCATION  lformat "%N" 
     ENDIF

ELSE

     IF EXISTS LIBS:FIGLETFONTS
          SETENV LOCATION "LIBS:FIGLETFONTS"
     ELSE
          SETENV LOCATION figletfonts
     ENDIF

ENDIF

;====================  SET UP SOME VARIABLES  ========================

SETENV FIGTEXT "Testing"
ECHO >RAM:FIG $FIGTEXT

;================   WRITE THE BUTTON FILE TO RAM: ====================

echo  >ram:FIG.buttons "     DISPLAY    ;EXECUTE F.CONV.scp []"
echo >>ram:FIG.buttons " SEND TO EDITOR ;EXECUTE F.editor.scp"
echo >>ram:FIG.buttons "UPDATE FONT LIST;EXECUTE F.update.scp"
echo >>ram:FIG.buttons "      HELP      ;TextWin Figlet F.help.txt"
echo >>ram:FIG.buttons "    SEE FONTS   ;Textwin Figlet F.fontpage.txt"
echo >>ram:FIG.buttons "    READ DOCS   ;TextWin Figlet F.Figlet.doc"
echo >>ram:FIG.buttons "   PRINT DOCS   ;EXECUTE F.print.scp"
echo >>ram:FIG.buttons "      QUIT      "

;=================   WRITE THE RADIO FILE TO RAM: ====================

echo  >ram:FIG.radio "Justify;Left;-l|Center;-c|Right;-r|By Dir.;-x"                  
echo >>ram:FIG.radio "Direction;Default;-X|L to R;-L|R to L;-R"
echo >>ram:FIG.radio "Width;80;|60;-w 60|40;-w 40|20;-w 20|1;-w 1"
echo >>ram:FIG.radio "Line Mode;One Line;|Paragraph;-p"
echo >>ram:FIG.radio "Smush Mode;Default;-m-2|No Smushing;-m-1|Kern Only;-m0|Checkboxs->;B"

;=================   WRITE THE CYCLE FILE TO RAM: ====================

echo >ram:FIG.cycle "Language;English;-E|Deutsch;-D"

;================   WRITE THE CHECKBOX FILE TO RAM: ==================

echo  >ram:FIG.checkbox "Eq Chars  ;+ 1"
echo >>ram:FIG.checkbox "Underscore;+ 2"
echo >>ram:FIG.checkbox "Hierarchy ;+ 4"
echo >>ram:FIG.checkbox "Op Pairs I;+ 8"
echo >>ram:FIG.checkbox "Op PairsII;+ 16"
echo >>ram:FIG.checkbox "Hardblanks;+ 32"

;================   WRITE THE STRING FILE TO RAM: ==================

echo  >ram:FIG.string "string0;Enter Text;100;100;$FIGTEXT"

;================   WRITE THE DEFINITION FILE TO RAM: ================

echo   >ram:FIG.cl "BEGIN"
echo  >>ram:FIG.cl "TITLE    *"Amiga Figlet by BOTH Software *"" 
echo  >>ram:FIG.cl "LV       MASTER.LIST MULTI SORT"
echo  >>ram:FIG.cl "RADIO    ram:FIG.radio"
echo  >>ram:FIG.cl "STRING   ram:FIG.string"
echo  >>ram:FIG.cl "CYCLE    ram:FIG.cycle"
echo  >>ram:FIG.cl "BUTTONS  ram:FIG.buttons"
echo  >>ram:FIG.cl "CHECKBOX ram:FIG.checkbox"
echo  >>ram:FIG.cl "NAME FIGLET"
echo  >>ram:FIG.cl "END"


MUInt ram:FIG.cl 

DELETE ram:FIG#? QUIET

IF EXISTS ENV:FIG
   DELETE ENV:FIG   QUIET
ENDIF

IF EXISTS ENV:LOCATION
   DELETE ENV:LOCATION   QUIET
ENDIF

QUIT


